package com.example.demo.behavior.chain;

/**
 * @Desc:
 * @Author zzz
 * @Date 2021/2/27
 * @Version V1.0
 */
public class ChainTest {
    /**
     * 公司员工请假
     * <= 7 加朋
     * <= 14 姚博
     * <= 21 冯博
     * 21 < x refuse
     */
    public static void main(String[] args) {
        Leader jiapeng = new JiaPeng();
        Leader yaobo = new YaoBo();
        Leader fengbo = new FengBo();
        jiapeng.setNext(yaobo);
        yaobo.setNext(fengbo);

        Staff zzz = new Staff("ZZZ", 5, jiapeng);
        Staff db = new Staff("DB", 10, jiapeng);
        Staff zy = new Staff("ZY", 25, jiapeng);
        Staff jp = new Staff("JP", 5, yaobo);

        zzz.leaveReq();
        db.leaveReq();
        zy.leaveReq();
        jp.leaveReq();
    }
}
